-
Notifications
You must be signed in to change notification settings - Fork 24.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continue removal of custom script code in ClassNode in Painless #52495
Conversation
Pinging @elastic/es-core-infra (:Core/Infra/Scripting) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
import static org.elasticsearch.painless.WriterConstants.CLASS_TYPE; | ||
import static org.elasticsearch.painless.WriterConstants.DEFINITION_TYPE; | ||
import static org.elasticsearch.painless.WriterConstants.DEF_BOOTSTRAP_DELEGATE_METHOD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove these constants from the code now right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Good catch.
@rjernst Thanks for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks for walking me through this.
@stu-elastic Thanks for the review. |
Relates to #49869 |
This continues down the path of removing custom code required for Elasticsearch Painless scripts from the user and ir nodes. This change uses ir nodes to inject gets methods, needs methods, and the bootstrap method as required. There is no reason for the SClass/ClassNode to know about these specific items.
Though, these appear as separate phases for now, this is purely transitional. Eventually, these will be rolled into a single "build" phase where the user tree is semantically checked and converted into an ir tree. This intermediate step is necessary to make the changes occur in smaller consumable steps.